package com.world.common.pojo;

import com.world.common.enums.HttpResultStatus;

import java.io.Serializable;

public class ResultResponse  implements Serializable {
	private static final long serialVersionUID = -3101075018265694443L;
    private String code;//状态码
    private String msg;//处理消息
	private Object data;

	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}

    /**
     * 默认失败
     */
    public ResultResponse(){
        this.code = HttpResultStatus.FAIL.getCode();
        this.msg = HttpResultStatus.FAIL.getMsg();
    }

    /**
     * 指定默认Code
     * @param enumItem
     */
    public ResultResponse(HttpResultStatus enumItem){
        this.code = enumItem.getCode();
        this.msg = enumItem.getMsg();
    }

    /**
     * 设置调用结果
     * @param enumItem
     */
    public void setResult(HttpResultStatus enumItem){
        this.code = enumItem.getCode();
        this.msg = enumItem.getMsg();
    }

    /**
     * 设置调用结果
     */
    public void setResult(String code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getMsg() {
        return msg;
    }
    public void setMsg(String msg) {
        this.msg = msg;
    }
}